import bianliang from "./bianliang.js";
class Bullet {
	constructor(x, y) {
		this.x = x;
		this.y = y;
		this.img = bianliang.resObj[2];
		this.width = this.img.width;
		this.height = this.img.height;
	}
	move() {
		this.y -= 40; 
		if (this.y <= 0) {
			var index = bianliang.bulletList.indexOf(this);
			bianliang.bulletList.splice(index,1);
		}
	}
	draw(ctx) {
		this.move();
		ctx.drawImage(this.img, this.x, this.y, this.width, this.height);
	}
}
export default Bullet;
